//http://poj.org/problem?id=3086
//递推题
//题意公式递推
#include<stdio.h>
using namespace std;
#define ll long long
int main(){
    int T;
    ll a[350]={0},b[350]={0};
    for(int i=1;i<=305;i++){
        b[i]=b[i-1]+i;
    }
    for(int i=1;i<=305;i++){
        a[i]=a[i-1]+i*b[i+1];
    }
    scanf("%d",&T);
    for(int i=1;i<=T;i++){
        int n;
        scanf("%d",&n);
        printf("%d %d %lld\n",i,n,a[n]);
    }
    return 0;
}